﻿import flash.display.BitmapData;
import cn.eminia.A2.utils.TxtDele;
/**
 * ...
 * @author wangjun
 */
 class cn.eminia.A2.utils.uBitmap 
{
	
	public function uBitmap() 
	{
		
	}
	
	public static function bmTxt(tf:TextField, mc:MovieClip):TxtDele {
		var txt_bmp:BitmapData = new BitmapData(tf._width, tf._height, true, 0x000000);
		txt_bmp.draw(tf);
		// 防御
		if (mc != null && mc.constructor != MovieClip ) trace("bmTxt::作为文字代理的mc 不是 MC");
		var dele:TxtDele = (mc != null )? mc :TxtDele.create (tf);
		trace('bmTxt = '+dele)
		dele.attachBitmap(txt_bmp, 1, "always", true);
		tf._visible = false;
		//tf.removeTextField();
		dele._x += 2;
		dele._y += 2;
		return dele;
	}
	
}